package cn.lystudio.rohmtimeopwide_background_v11.config;

import org.springframework.http.CacheControl;
import org.springframework.stereotype.Component;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

//静态资源配置
@Component
public class ResourceConfig implements WebMvcConfigurer {
    //@Value("${appFileUpload.filePathDir}")
    //private String  imageFileDir;
    //@Value("${appFileUpload.attachPathDir}")
    //private String qcAttachFileDir;

    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        //registry.addResourceHandler("/**").addResourceLocations("classpath:/static/").setCacheControl(CacheControl.noCache());
        registry.addResourceHandler("/*/*.html","/*/*.css","/*/*.js")
                .addResourceLocations("classpath:/static/")
                .setCacheControl(CacheControl.noCache());
        //registry.addResourceHandler("/image/**")
        //        .addResourceLocations("file:"+imageFileDir+ FileUtil.FILE_SEPARATOR);
        //registry.addResourceHandler("/qcattach/**")
        //        .addResourceLocations("file:"+qcAttachFileDir+ FileUtil.FILE_SEPARATOR);
    }
}
